<template>
  <div class="app-container">
    <el-row :gutter="15" class="mb8">
      <el-form
        ref="baseDataParamRef"
        :model="baseDataParam"
        class="el-form-search"
        inline="inline"
      >
        <el-form-item class="el-form-search-item" label="时间粒度">
          <el-select v-model="baseDataParam.dateType" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="el-form-search-item">
          <el-button size="mini" type="primary" @click="searchHandel"
            >搜索
          </el-button>
        </el-form-item>
      </el-form>
    </el-row>

    <!--折线图-->
    <el-row style="background: #fff">
      <el-col :span="24" style="display: flex; justify-content: space-between">
        <!--平均值-->
        <line-chart
          ref="lineChart3"
          :baseDataParam="baseDataParam"
          polymers-type="average"
        />
        <!--最小值-->
        <line-chart
          ref="lineChart3"
          :baseDataParam="baseDataParam"
          polymers-type="min"
        />
      </el-col>
      <el-col>
        <!--最大值-->
        <line-chart
          ref="lineChart3"
          :baseDataParam="baseDataParam"
          polymers-type="max"
        />
      </el-col>
    </el-row>
  </div>
</template>

<script>
// 折线图
import LineChart from "@/views/dashboard/LineChart3.vue";
import PanelGroup from "@/views/dashboard/PanelGroup.vue";

export default {
  components: {
    PanelGroup,
    LineChart,
  },
  data() {
    return {
      baseDataParam: {},
      lineHeight: document.documentElement.clientHeight - 350 + "px", //实时屏幕高度
      options: [
        { label: "分", value: "minute" },
        { label: "时", value: "hour" },
        { label: "天", value: "day" },
      ],
    };
  },
  created() {},
  methods: {
    searchHandel() {
      this.$refs.lineChart3.initChart();
    },
  },
};
</script>
